import java.util.Random;
import java.util.Scanner;

public class Work7 {
    public static void print(String[] audience) {
        for (int i = 0; i < audience.length; i++) {
            System.out.println("第" + (i + 1) + "个观众姓名:" + audience[i]);
        }
    }

    public static String extract(String[] audience) {
        Random random = new Random();
        return audience[random.nextInt(3)];
    }

    public static void main(String[] args) {

        String[] audience = new String[3];
        System.out.println("_________抽取幸运观众_________");
        Scanner scanner = new Scanner(System.in);

        System.out.println("储存第一个姓名:");
        audience[0] = scanner.nextLine();
        System.out.println("储存第二个姓名:");
        audience[1] = scanner.nextLine();
        System.out.println("储存第三个姓名:");
        audience[2] = scanner.nextLine();

        print(audience);
        extract(audience);
        System.out.println("随机抽取的幸运观众是:" + extract(audience));
    }
}
